<template>
  <input type="checkbox" :checked="getValue(checked)" @change="change" />
</template>

<script>
export default {
  model: {
    prop: "checked",
    event: "change",
  },
  watch: {},
  methods: {
    getValue(value) {
      console.log(value);
      return value;
    },
    change(e) {
      let val = e.target.checked;
      console.log("checkbox-change", val);
      this.$emit("change", val);
    },
  },
  props: {
    checked: [Boolean, String],
  },
};
</script>

<style lang="scss" scoped></style>
